package com.general.seckill.stockservice;

import com.general.seckill.stockservice.feign.OrderServiceFeign;
import com.general.seckill.stockservice.request.StockDecreaseDTO;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * @description: StockController
 * @author: general
 * @version: 1.0
 * @create: 2022-04-30 16:06
 **/
@RestController
@RequestMapping("stock")
public class StockController {

    @Resource
    private StockService stockService;

    @Resource
    private OrderServiceFeign orderServiceFeign;

    @PostMapping("decrease")
    public Map<String, Object> decreaseStock(@RequestBody StockDecreaseDTO decreaseDTO){
        return stockService.decreaseStock(decreaseDTO);
    }
}
